package lib.bone.access.module.post;

import lib.bone.access.module.post.domain.NepuPost;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Optional;

@Repository
public interface NepuPostDAO extends JpaRepository<NepuPost, String> {
    /**
     * 根据ID删除
     */
    void deleteById(String id);
    /**
     * 批量删除
     */
    @Modifying
    void deleteByIdIn(List<Long> ids);


    Optional<NepuPost> findByPostType(String name);
    /**
     * 判断存在
     */
    Boolean existsByPostTypeAndPostLevelAndPostGrade(String postType,String postLevel,String postGrade);
}
